<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>初心博客后台管理系统</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
    <meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
    <meta name="author" content="yinqi">
    <link href="/plugins/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="/css/admin.css" rel="stylesheet">
    <link rel="stylesheet" href="/plugins/wangEditor/wangEditor.min.css">
</head>

<body>
    <div class="lyear-layout-web">
        <div class="lyear-layout-container">
             <!--左侧导航-->
            <% include sliderBar%>
            <!--End 左侧导航-->
            
            <!--头部信息-->
            <% include headerBar%>
            <!--End 头部信息-->

            <!--页面主要内容-->
            <main class="lyear-layout-content">

                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="card">
                                <div class="card-header">
                                    <h4>添加文章</h4>
                                </div>
                                <div class="card-body">
                                    <div class="left">
                                        <form action="/admin/addArtical" method="post">
                                            
                                            <div class="create">
                                                <div class="leixin">
                                                    <label>选择文章类型:</label>
                                                    <select class="form-control" name="classId">
                                                     <%   types.forEach((type)=>{%>
                                                            <option value="<%=type.classId%>"><%=type.className%></option>

                                                     <%   })%>                      
                                                </select>
                                                </div>
                                                <div class="title">
                                                    <input type="text" class="form-control" name="articalName" placeholder="请输入文章标题">
                                                </div>
                                                <div class="articalTxt">
                                                </div>
                                                <textarea name="content" id="content" cols="30" rows="10" style="display: none"></textarea>
                                                <input type="submit" class="btn btn-primary" value="添加">
                                            </div>
                                        </form>

                                    </div>
                                </div>
                            </div>

                        </div>

                    </div>

            </main>
            <!--End 页面主要内容-->
            </div>
        </div>

        <script type="text/javascript" src="/plugins/jquery/jquery-3.4.0.min.js"></script>
        <script type="text/javascript" src="/plugins/bootstrap/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
        <script src="/plugins/bootstrapPager.js"></script>
        <script src="/plugins/wangEditor/wangEditor.min.js"></script>
        <script type="text/javascript" src="/js/main.min.js"></script>
        <script>
            $(function(){
                var E = window.wangEditor
                var editor = new E('.articalTxt')
                    // 下面两个配置，使用其中一个即可显示“上传图片”的tab。但是两者不要同时使用！！！
                editor.customConfig.uploadImgShowBase64 = true // 使用 base64 保存图片
                    // editor.customConfig.uploadImgServer = '/upload'  // 上传图片到服务器
                editor.customConfig.onchange = function (html) {
                // 监控变化，同步更新到 textarea
                $('#content').val(html)
                 }
                editor.create()
            });

        </script>
</body>

</html>